package davidlauzon.activerecord.nodes;

import davidlauzon.activerecord.nodes.field.Field;
import davidlauzon.activerecord.visitor.SqlSerializer;

public class CreateTableStatement extends SqlStatement
{
    /*********************************************************************************************
     * VARIABLES
     *********************************************************************************************/
    private Table       _table;
    private boolean     _ifNotExists;
    private Field[]     _columns;
    
    
    /*********************************************************************************************
     * SIMPLE GETTER & SETTERS
     *********************************************************************************************/
    public Table   table()       { return _table; }
    public boolean ifNotExists() { return _ifNotExists; }
    public Field[] columns()     { return _columns; }
    
    
    /*********************************************************************************************
     * PUBLIC METHODS
     *********************************************************************************************/
    public CreateTableStatement() {
        super();
        _ifNotExists = false;
    }
    
    public void setTable(Table table) {
        _table = table;
    }
    
    public void setColumns(Field[] columns) {
        _columns = columns;
    }
    
    public void setIfNotExists(boolean value) {
        _ifNotExists = value;
    }

    @Override
    public String accept(SqlSerializer visitor) {
        return visitor.visit( this );
    }
}
